for i in range(100,1000):
    s = 0
    temp = i
    while temp:
        s = s + (temp % 10)** 3
        temp = temp // 10
    if s == i:
        print(i)
    else :
        continue
